const path = require('path')
const {CleanWebpackPlugin} = require("clean-webpack-plugin")
const WebWebpackPlugin = require("web-webpack-plugin")
const HtmlWebpackPlugin = require("html-webpack-plugin")
const CopyWebpackPlugin = require("copy-webpack-plugin")
const Webpackbar = require("webpackbar")

module.exports = {
    mode:"none",
    entry:{},
    output:{
        filename:"[name][hash:8].js",// 通过[name]这种占位符的方式动态输出文件名，[name]最终就会替换成打包入口名称
        path:path.resolve(__dirname,"dist")
    },
    module:{
        rules:[
            {
                test:/\.css$/,
                use:[
                    "style-loader",
                    "css-loader"
                ]
            }
        ]
    },
    plugins:[
        new Webpackbar(),
        new CleanWebpackPlugin(),
        new CopyWebpackPlugin({
            patterns:[
                {from:"./example/card/",to:"./card"},
                {from:"./example/food",to:"./food"},
                {from:"./example/home",to:"./home"},
                {from:"./example/grocery",to:"./grocery"},
                {from:"./example/neon-effect",to:"./neon-effect"}
            ]
        }),
    ]

}
